﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tb="http://www.hardcodet.net/taskbar"
                    xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Style/BaseControlStyles/ContextMenuStyle.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <ControlTemplate x:Key="MenuSeparatorTemplate">
        <Separator>
            <Separator.Style>
                <Style TargetType="Separator">
                    <Setter Property="Margin" Value="4,2,4,2" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type Separator}">
                                <Grid>
                                    <Rectangle Height="1" Stroke="{StaticResource SeperatorBrush}" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Separator.Style>
        </Separator>
    </ControlTemplate>

    <tb:TaskbarIcon x:Key="TrayIcon"
                    IconSource="Resources/World_Completion2.ico"
                    MenuActivation="All"
                    ToolTipText="GW2 Personal Assistant Overlay">
        <tb:TaskbarIcon.ContextMenu>
            <ContextMenu>
                <ContextMenu.ItemContainerStyle>
                    <Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
                        <Setter Property="Command" Value="{Binding OnClickCommand}" />
                        <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
                        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                        <Setter Property="Header" Value="{Binding Header}" />
                        <Setter Property="ItemsSource" Value="{Binding SubMenuItems}" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding}" Value="{x:Null}">
                                <Setter Property="Template" Value="{StaticResource MenuSeparatorTemplate}" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContextMenu.ItemContainerStyle>
            </ContextMenu>
        </tb:TaskbarIcon.ContextMenu>
    </tb:TaskbarIcon>

</ResourceDictionary>